from pyvision import Report
import pandas as pd
import matplotlib.pyplot as plt


# 支持 pandas 和 matplotlib 输出
fig, ax = plt.subplots()
X = 'a b c d e'.split(' ')
height = [5, 20, 15, 25, 5]
bars = ax.bar(X, height, width=0.6)

df = pd.DataFrame(
    {
        'col1': 'a b c d'.split(),
        'col2': [1, 2, 3, 4]
    }
)

(
    Report()
    .add_md('# 支持 pandas 和 matplotlib 输出')
    .add_table(df)
    .add_mpl_chart(fig)
    .to_html('outputs/case1.html')
)
